#pragma once
#include "Component.h"
#include "Vertex.h"

class Model :
	public Component
{
public:
	Model();
	virtual ~Model();

	virtual void OnLostDevice();
	virtual void OnResetDevice();
	virtual void Update(float dt);
	virtual void Draw(ID3DXSprite* sprite, D3DXMATRIX& view, D3DXMATRIX& proj);

protected:
	virtual void BuildVertexBuffer() = 0;
	virtual void BuildIndexBuffer(){}

	IDirect3DVertexBuffer9* mVB;
	IDirect3DIndexBuffer9* mIB;

	ID3DXEffect* mFX;
	ID3DXBuffer* mErrors;

	D3DXHANDLE mhWVP;
	D3DXHANDLE mhTech;
};

